Introduction To Siemens Counter Instructions

Published on May31, 2021 | Category: counter
Share this article:

counter Instructions use to counts bits by incrment or decrment by 1. generally two type of counter are used either UP counter or down counter.Counters have memory area reserved for them in the memory of CPU. This memory area reserves one 16-bit word for each counter address. set counter preset value by entering a number from 0 to 999, for example : C#127. The C# stands for binary coded decimal format, 127 is a preset value of a counter. The ladder logic instruction set supports 256 counters. The counter instructions are the only functions that have access to the counter memory area.

siemens plc S_CU, Up Counter Instructions

The counter is incremented by one if the signal state at input CU changes from 0 to 1, each rising edge signal at the inputs CU incrment counter value by 1.

img/counterup.webp

siemens plc S_CD, Down Counter Instructions

if the set (S) input is 1 and counter value CV is greater than 1. at each rising edge at input CD decremented counter value by 1 untill CV is equal to 0. output Q is 1 if the current counter value is greater than 0. output Q is 0, if the current counter value is equal to zero.

img/counterdown.webp

siemens plc S_CUD Up-Down Counter

Up-Down Counter perform UP or down counting bits , when input of CU changes 0 to 1 than counter increment counter value by 1 and if input CD changes 0 to 1 than counter decremented counter value by 1.output Q is 1 if the counter value is greater than zero and 0.

siemens up/down Counter Instructions

siemens plc Set Counter Value coil Instructions

this coil set, preset value into the specified counter.

img/setcounter.webp

siemens plc Up Counter Coil Instructions

up counter coil incremnt counter value by 1 at specified counter number. each positive edge of the input contact increment counter value by 1 untill counter value is less than 999.

img/upcountercoil.webp

siemens plc down Counter Coil Instructions

The Down Counter instruction decrements the value of a specified counter by 1 if there is a signal change 0 to 1 at the input of coil.

img/counterdeccoil.webp

siemens plc example of siemens counter

in this example counter up instrunction is used, move instrunction set preset value. timer instrunction set 1 at the input of counter CU periodically every 2 second. compariosn block compare preset value and current value if both are equal than counter reset , and start from beginning. counter up reset if the value is greater than Preset value, counter up block input is depent on timer output, reset manually or bit depend on compariosn block.

siemens counter example

siemens counter example